<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$this->items[] = array();

for($i=0; $i<sizeof($this->items); $i++) : 
	$item = $this->items[$i]; 
?>
	<tr class="row<?php echo $i % 2; ?> <?php echo ($i == sizeof($this->items)-1 ? 'hide' : ''); ?>">
		<td class="center">
			<span class="hide"><?php echo JHtml::_('grid.id', ($i != sizeof($this->items)-1 ? $i : ''), $item->id); ?></span>
			<input type="hidden" name="id[]" value="<?php echo $item->id; ?>" />
			<input required type="text" class="readonly editable" readonly="readonly" size="30" name="name[]" value="<?php echo $this->escape($item->name); ?>" title="<?php echo $this->escape($item->note); ?>" />
		</td>
		<td class="center">
			<?php 
				$side = array();
				$side[] = JHTML::_('select.option', $value = '1', $text= JText::_( 'COM_MARIAGEPLANNER_GUEST_HUSBAND' ), 'value', 'text', $disable=false );
				$side[] = JHTML::_('select.option','0', JText::_( 'COM_MARIAGEPLANNER_GUEST_WIFE' ) );
				echo JHTML::_('select.genericlist', $side, $name = 'side[]', $attribs = 'readonly="readonly" class="readonly editable"', $key = 'value', $text = 'text', $selected = $item->side, $idtag = false, $translate = false );			
			?>
		</td>
		<td class="center">
			<?php
				$state = array();
				$state[] = JHTML::_('select.option','1', JText::_( 'COM_MARIAGEPLANNER_GUEST_WILL' ) );
				$state[] = JHTML::_('select.option','0', JText::_( 'COM_MARIAGEPLANNER_GUEST_POSSIBLY' ) );
				$state[] = JHTML::_('select.option','-1', JText::_( 'COM_MARIAGEPLANNER_GUEST_UNLIKELY' ) );
				echo JHTML::_('select.genericlist', $state, $name = 'state[]', $attribs = 'readonly="readonly" class="readonly editable"', $key = 'value', $text = 'text', $selected = $item->state, $idtag = false, $translate = false );			
			?>		
		</td>
		<td class="center">
			<?php
				$invite = array();
				$invite[] = JHTML::_('select.option','-1', JText::_( 'COM_MARIAGEPLANNER_GUEST_NOT_SERVED' ) );
				$invite[] = JHTML::_('select.option','2', JText::_( 'COM_MARIAGEPLANNER_GUEST_SERVED' ) );
				$invite[] = JHTML::_('select.option','0', JText::_( 'COM_MARIAGEPLANNER_GUEST_NOT_SENT' ) );
				$invite[] = JHTML::_('select.option','1', JText::_( 'COM_MARIAGEPLANNER_GUEST_SENT' ) );
				echo JHTML::_('select.genericlist', $invite, $name = 'invitation[]', $attribs = 'readonly="readonly" class="readonly editable"', $key = 'value', $text = 'text', $selected = $item->invitation, $idtag = false, $translate = false );
			?>		
		</td>
		<!--td class="center">
			<input type="text" class="readonly editable" readonly="readonly" size="10" name="table[]" value="<?php echo $this->escape($item->table); ?>" />
		</td-->
		<td class="center nowrap">
			<a class="jgrid edit" href="javascript:void(0);" onclick="MP_EditGuest(this);" title="Редактировать"><span class="state edit"><span class="text">Редактировать</span></span></a>
			<a class="jgrid hide save" href="javascript:void(0);" onclick="MP_ShowThrobber(); listItemTask(jQuery(this).closest('tr').find('input[name^=cid]').attr('id'),'guests.save');" title="Сохранить"><span class="state save"><span class="text">Сохранить</span></span></a>
			<a class="jgrid" href="javascript:void(0);" onclick="MP_RemoveGuest(this);" title="Удалить строку"><span class="state delete"><span class="text">Удалить</span></span></a>
		</td>
	</tr>
				
<?php endfor; ?>